// 填充
import { fillPatternPointsMap } from '../algorithm/fill.js'
import { _props } from "./canvas.js";
import { _path } from "./path.js";
import { PATH_MODE } from "../common/pathMode.js";
export const _fill = (ctx, options, props) => {

    let { points = [], fill = {} } = options
    let { pattern, r, a } = fill

    let fn = fillPatternPointsMap[pattern]
    let ps = fn({ points, r, a })

    ctx.save();
    _props(ctx, props)
    _path(ctx, {
        pathMode: PATH_MODE.LINES,
        points: ps,
    }, props)
    ctx.stroke()
    ctx.restore();
}
